package com.hujiheng.paike.service.impl;

import com.hujiheng.paike.mapper.StudentMapper;
import com.hujiheng.paike.pojo.Student;
import com.hujiheng.paike.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public Student getById(int studentId) {
        return studentMapper.getById(studentId);
    }

    @Override
    public List<Student> getStudentsByName(String studentName) {
        return studentMapper.getStudentsByName(studentName);
    }

    @Override
    public List<Student> getStudentsByClassId(int classId) {
        return studentMapper.getStudentsByClassId(classId);
    }

    @Override
    public List<Student> getStudentsBySex(String sex) {
        return studentMapper.getStudentsBySex(sex);
    }

    @Override
    public List<Student> getStudentsLikeName(String studentName) {
        return studentMapper.getStudentsLikeName(studentName);
    }

    @Override
    public List<Student> getStudentList() {
        return studentMapper.getStudentList();
    }

    @Override
    public int addStudent(Student student) {
        return studentMapper.addStudent(student);
    }

    @Override
    public int updateStudent(Student student) {
        return studentMapper.updateStudent(student);
    }

    @Override
    public int deleteStudent(int studentId) {
        return studentMapper.deleteStudent(studentId);
    }
}
